<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<link rel="stylesheet" th:href="@{/api/css/jquery.pagination.css}">
<script th:src="@{/api/js/jquery.pagination.min.js}"></script>
<html>
<head>
    <%--  BootStrap--%>
    <link href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">

    <title>书籍展示</title>
</head>
<body>
<div>
    <div class="col-md-3" id="myScrollspy" style="margin-top: 100px">
        <ul class="nav nav-tabs nav-stacked" data-spy="affix" data-offset-top="125">
            <li class="active" style="height:50px;"><a href="#section-1">第一部分</a></li>
            <li style="height:50px;"><a href="${pageContext.request.contextPath}/supplier/getsupplier">供应商管理</a></li>
            <li style="height:50px;"><a href="#section-3">进货管理</a></li>
            <li style="height:50px;"><a href="#section-4">退货管理</a></li>
            <li style="height:50px;"><a href="#section-5">日常销售管理</a></li>
            <li style="height:50px;"><a href="#section-6">用户</a></li>
        </ul>
    </div>
    <div class="container" style="float: right">
        <div class="row clearfix">
            <div class="col-md-12 column">
                <div class="page-header">
                    <h1>
                        <smla>用品列表----------显示所有宠物用品</smla>
                    </h1>
                </div>
            </div>
            <div class="row" >
                <div class="col-md-4 colum">
                    <%--                toaddbook--%>
                    <a class="btn btn-primary" href="${pageContext.request.contextPath}/book/toAddBook">新增用品</a>
                    <a class="btn btn-primary" href="${pageContext.request.contextPath}/book/finall">显示全部用品</a>
                </div>
            </div>
            <div class="col-md-4 column">


            </div>
            <div class="row">
                <div class="col-md-4 colum" style="display: inline">

                    <%--               查询书籍--%>
                    <form action="${pageContext.request.contextPath}/book/querybook"   method="post" style="float:right;display: inline "  class="form-inline">
                        <input type="text" class="form-control" name="queryBookName" placeholder="请输入要查询用品名称"  style="display: inline-block"/>
                        <input type="submit" value="查询"  style="display: inline-block" class="btn btn-primary"/>
                    </form>


                    <form action="${pageContext.request.contextPath}/book/querybook"   method="post" style="float:right; display: inline" class="form-inline">
                        <input type="text" class="form-control" name="queryBookName" placeholder="请输入要查询的用品编号"/>
                        <input type="submit" value="查询" class="btn btn-primary"/>
                    </form>






                </div>
            </div>
        </div>
        <div class="row clearfix">
            <div class="col-md-12 column">
                <table class="table table-hover table-striped">
                    <thead>
                    <tr>
                        <th>编号</th>
                        <th>名称</th>
                        <th>数量</th>
                        <th>备注</th>
                    </tr>
                    </thead>
                    <%--           书籍是从数据库中查询出来 从这个list中遍历出来：foreach--%>
                    <tbody>
                    <%--<c:forEach var="book" items="${requestScope.get(list)}"              --%>
                    <c:forEach var="book" items="${pageInfo.list}">
                        <tr>
                            <td>${book.bookID}</td>
                            <td>${book.bookName}</td>
                            <td>${book.bookCounts}</td>
                            <td>${book.detail}</td>
                            <td>

                                <a href="${pageContext.request.contextPath}/book/toUpdate?id=${book.bookID}" >修改</a>
                                &nbsp; | &nbsp;
                                <a href="${pageContext.request.contextPath}/book/deleteBook/${book.bookID}">删除</a>

                            </td>
                        </tr>
                    </c:forEach>


                    </tbody>
                    <tfoot>
                    <tr>
                        <td>当前页:${pageInfo.pageNum}</td>
                        <td><a href="/book/finall/?pageNum=${pageInfo.prePage}& pageSize=${pageInfo.pageSize}">前一页：${pageInfo.prePage}</a></td>
                        <td><a href="/book/finall/?pageNum=${pageInfo.nextPage}& pageSize=${pageInfo.pageSize}">下一页：${pageInfo.nextPage}</a></td>
                        <td><a href="/book/finall/?pageNum=${pageInfo.pages}& pageSize=${pageInfo.pageSize}">尾页：${pageInfo.prePage}</a></td>
                        <td>一共：${pageInfo.pages}</td>

                    </tr>
                    </tfoot>
                </table>

            </div>
        </div>
    </div>
</div>
<div class="box">


</div>

</body>
</html>

